from jcramda.core import CurriedF
from typing import Any, AnyStr, Iterable, Callable, Optional, Mapping, Tuple, TypeVar, overload

_RE = TypeVar('_RE')


def replace(old_str: AnyStr, new_str: AnyStr, s: AnyStr = ...,
            _count: int = ...) -> CurriedF[str]: ...
def sformat(tmpl: str, s: AnyStr = ..., *args, **kwargs) -> CurriedF[str]: ...
def strip(s: str, chars: AnyStr =...) -> CurriedF[str]: ...
def lstrip(s: str, chars: AnyStr =...) -> CurriedF[str]: ...
def rstrip(s: str, chars: AnyStr =...) -> CurriedF[str]: ...
def strcount(rs: str, s: str, start: Optional[int] =..., end: Optional[int] =...) -> CurriedF[int]: ...
def encode(s: AnyStr, errors: str=..., encoding: str=...) -> CurriedF[bytes]: ...
def decode(bs: AnyStr) -> str: ...
def expandtabs(tab_size: int, s: str = ...) -> CurriedF[str]: ...
def find(rs: str, s: str = ..., start: Optional[int] =..., end: Optional[int] =...) -> CurriedF[int]: ...
def rfind(rs: str, s: str = ..., start: int=..., end: int =...) -> CurriedF[str]: ...
@overload
def join(sep: str, seqs: Iterable) -> str: ...
@overload
def join(sep: str) -> Callable[[Iterable], str]: ...
def ljust(width: int, s: str = ..., fillchar: str=...) -> CurriedF[str]: ...
def rjust(width: int, s: str = ..., fillchar: str=...) -> CurriedF[str]: ...
def translate(opts: dict, s: str = ...) -> CurriedF: ...
def rindex(sub: AnyStr, s: str=..., start: int=..., end: int=...) -> CurriedF[int]: ...
def split(sep: AnyStr, s: str=..., limit: int=...) -> CurriedF[list]: ...
def rsplit(sep: AnyStr, s: str=..., limit: int=...) -> CurriedF[list]: ...
def center(width: int, s: str, fill_char: str = ...) -> CurriedF[str]: ...
def format_map(mapper: Mapping, s: str=...) -> CurriedF[str]: ...
def partition(sep: str, s: str=...) -> CurriedF[Tuple[str, str, str]]: ...
def rpartition(sep: str, s: str=...) -> CurriedF[Tuple[str, str, str]]: ...
def zfill(length: int, s: str=...) -> CurriedF[str]: ...
def first_lower(s: str) -> str: ...
def hex_token(size: int) -> str: ...
def url_safe_token(size: int) -> str: ...
def hex_uuid() -> str: ...
def camelcase(s: AnyStr, sep: str = ...) -> str: ...
def camelcase_to(sep: str, s: AnyStr=..., trans_f: Callable =...) -> CurriedF[str]: ...
def rand_txt(length: int, char_set: str = ...) -> CurriedF[str]: ...
def repeat_txt(n: int, s: str=...) -> CurriedF[str]: ...
def mask(start: int, stop: int, raw: str=..., char: str = ...) -> CurriedF[str]: ...
def mask_except(_head: int, _tail: int, s: str=..., char: str = ...) -> CurriedF[str]: ...
def hexdigest(algorithm: str, raw: AnyStr=..., length: int = ...) -> CurriedF[str]: ...
def b64_encode(s: AnyStr) -> str: ...
def b64_urlsafe_encode(s: AnyStr) -> str: ...
def b64_decode(s: AnyStr) -> str: ...
def b64_urlsafe_decode(s: AnyStr) -> str: ...
def search(pattern: str, s: str=..., flags: int = ...) -> CurriedF[_RE]: ...
def match(pattern: str, s: str=..., flags: int = ...) -> CurriedF[_RE]: ...
def fullmatch(pattern: str, s: str=..., flags: int = ...) -> CurriedF[_RE]: ...
def resub(pattern: str, repl: str, s: str = ..., flags: int = ...) -> CurriedF[_RE]: ...
def resubn(pattern: str, repl: str, s: str = ..., count: int = ..., flags: int = ...) -> CurriedF[_RE]: ...
def finditer(pattern: str, s: str = ..., flags: int = ...) -> CurriedF[_RE]: ...
def findall(pattern: str, s: str = ..., flags: int = ...) -> CurriedF[_RE]: ...
def url_join(*args: str) -> str: ...
def wraps(wrap_char: str, txt: str) -> CurriedF[str]: ...
